package com.inexas.cu.client.register;

import com.inexas.cu.client.pipe.*;

public class CurrentUser extends UserSessionResponse {
	private static final long serialVersionUID = 7297154941559271868L;
	private String accountName, firstName, lastName;

	@SuppressWarnings("unused")
	private CurrentUser() {
		// Serialization only
	}

	public CurrentUser( //
	        AbstractRequest request, //
	        String accountName, //
	        String firstName, //
	        String lastName) {
		super(request);
		this.accountName = accountName;
		this.firstName = firstName;
		this.lastName = lastName;
	}

	public CurrentUser(AbstractRequest request) {
		super(request);
	}

	public CurrentUser(SignIn request, String errorMessage) {
		super(request);
		setErrorMessage(errorMessage);
	}

	public String getAccountName() {
		return accountName;
	}

	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	@Override
	public String toString() {
		return errorMessage == null ? //
		"CurrentUser(" + firstName + ", " + lastName + ')'
		        : "CurrentUser-ERROR(" + errorMessage + ')';
	}

}